import request from '@/utils/request'
/**
 * 采购管理
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/purchase-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/tender-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/journal-controller}
 */
const categoryMod = '/category'
const purchaseMod = '/purchase'
const tenderMod = '/tender'
const journalMod = '/journal'

/**
 * [getRoot 查询根栏目]
 */
export function getRoot(data) {
    return request({
        url: `${categoryMod}/getRoot`,
        method: 'post',
        data
    })
}

/**
 * [getSub 查询指定类别下小类别]
 */
export function getSub(data) {
    return request({
        url: `${categoryMod}/getSub`,
        method: 'post',
        data
    })
}

/**
 * [getById 获取采购详情]
 */
export function getPurchaseById(data) {
    return request({
        url: `${purchaseMod}/getById`,
        method: 'post',
        data
    })
}

/**
 * [getById 获取投标详情]
 */
export function getTenderById(data) {
    return request({
        url: `${tenderMod}/getById`,
        method: 'post',
        data
    })
}

/**
 * [reportInput 生成进货单]
 */
export function reportInput(data) {
    return request({
        url: `${journalMod}/reportInput`,
        method: 'post',
        data
    })
}

/**
 * [reportOutput 生成销售单]
 */
export function reportOutput(data) {
    return request({
        url: `${journalMod}/reportOutput`,
        method: 'post',
        data
    })
}

/**
 * [reportStore 生成库存表]
 */
export function reportStore(data) {
    return request({
        url: `${journalMod}/reportStore`,
        method: 'post',
        data
    })
}